<template>
  <div class="wholeshop">
    <ul>
      <li
        v-for="item in list"
        :key="item.id"
        v-show="item.id == 99764"
        @click="gotoWhole(item.id)"
      >
        <div class="left-img">
          <img :src="item.pic" alt="" />
        </div>
        <div class="right-text">
          <span class="xi">{{ item.name }}</span>
          <span class="grows">{{ item.characteristic }}</span>
          <div class="price">
            <p>
              <span class="red">{{ "￥" + item.minPrice }}</span>
              <span>低价</span>
            </p>
            <p>
              <span class="grow">{{ "￥" + item.originalPrice }}</span>
              <span class="grow">原价</span>
            </p>
            <p>
              <span class="grow">{{ item.stores }}件</span>
              <span class="grow">限量</span>
            </p>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import { getWholeshop } from "../../utils/api/index";
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    getWholeshop().then((res) => {
      this.list = res.data.goodsMap;
    });
  },
  methods: {
    gotoWhole(id) {
      this.$router.push({ path: "/wholedetail", query: { id } });
    },
  },
};
</script>

<style lang="scss" scoped>
.wholeshop {
  width: 100%;
  height: 3.5rem;
  border-bottom: 0.3rem solid #f5f5f5;
  li {
    display: flex;
    justify-content: space-around;
    padding-top: 0.2rem;
    .left-img {
      width: 35%;
      height: 100%;
      img {
        width: 2.5rem;
        height: 3rem;
      }
    }
    .right-text {
      width: 50%;
      height: 100%;
      span {
        display: block;
      }
      .xi {
        font-size: 0.3rem;
      }
      .grows {
        color: #cccccc;
      }
      .price {
        display: flex;
        justify-content: space-around;
        box-sizing: border-box;
        padding-top: 1.2rem;
        text-align: center;
        padding-right: 0.9rem;
        .red {
          color: red;
          font-weight: 700;
        }
        .grow {
          color: #cccccc;
        }
      }
    }
  }
}
</style>
